 <template>
   <Card :shadow="shadow">
      <div class="card-name">
        <div class="name width2">对账文件信息</div>
      </div>
      <i-form ref="formValidate" :model="formValidate" class="content-con margin">
        <div class="form-item">
          <Row :gutter="24">
            <i-col span="12">
              <Form-item prop="uid">
                <Row>
                  <i-col span="8" class="ban-left">
                    商户ID
                  </i-col>
                  <i-col span="16">
                    <i-input v-model="formValidate.uid" size="large"></i-input>
                  </i-col>
                </Row>
              </Form-item>
            </i-col>
            <i-col span="12">
              <Form-item prop="nickname">
                <Row>
                  <i-col span="8" class="ban-left">
                    商户名称
                  </i-col>
                  <i-col span="16">
                    <i-input v-model="formValidate.nickname" size="large" placeholder="输入商户名称"></i-input>
                  </i-col>
                </Row>
              </Form-item>
            </i-col>
          </Row>
          <Row :gutter="24">
            <i-col span="12">
              <Form-item prop="merchantType">
                <Row>
                  <i-col span="8" class="ban-left">
                    商户类型
                  </i-col>
                  <i-col span="16">
                    <i-input v-model="formValidate.merchantType" size="large" placeholder="输入商户类型"></i-input>
                  </i-col>
                </Row>
              </Form-item>
            </i-col>
            <i-col span="12">
              <Form-item prop="status">
                <Row>
                  <i-col span="8" class="ban-left">
                    状态
                  </i-col>
                  <i-col span="16" style="padding-left: 15px;">
                    <RadioGroup v-model="formValidate.status">
                      <Radio label="0" size="large" border><span>未生成</span></Radio>
                      <Radio label="1" size="large" border><span>已生成</span></Radio>
                    </RadioGroup>
                  </i-col>
                </Row>
              </Form-item>
            </i-col>
          </Row>
          <Row :gutter="24">
            <i-col span="12">
              <Form-item prop="date">
                <Row>
                  <i-col span="8" class="ban-left">
                    对账日期
                  </i-col>
                  <i-col span="16">
                    <DatePicker size="large" type="date" v-model="formValidate.date" style="width: 100%;" placeholder="对账日期"></DatePicker>
                  </i-col>
                </Row>
              </Form-item>
            </i-col>
            <i-col span="12">
              <Form-item prop="time">
                <Row>
                  <i-col span="8" class="ban-left">
                    创建时间
                  </i-col>
                  <i-col span="16">
                    <Date-picker v-model="formValidate.time" size="large" style="width: 100%;" type="datetime" placeholder="创建时间"></Date-picker>
                  </i-col>
                </Row>
              </Form-item>
            </i-col>
          </Row>
        </div>
        <Form-item class="ban-btn">
          <i-button @click="handleSubmit()" class="save" size="large">保存</i-button>
          <i-button class="save" size="large" @click="btnClick1">返回</i-button>
        </Form-item>
      </i-form>
   </Card>

 </template>
 <script>
import { mapMutations } from 'vuex'
 export default {
   name: 'rate',
   props:{
     shadow: {
       type: Boolean,
       default: false
     }
   },
   data() {
     return {
       formValidate: {
         uid: '20000032',
         nickname: '测试',
         merchantType: '商户类型',
         status: '1',
         date: '',
         time: ''
       }
     };
   },
   methods: {
     // 表单验证
     handleSubmit () {
       this.$refs['formValidate'].validate(valid => {
         if (valid) {
           // console.log(this.formValidate)
           // saveChannel(this.formValidate).then(res => {
           //   this.$Message.success(res.msg)
           //   setTimeout(() => this.close(), 1000)
           // }).catch(res => {
           //   this.$Message.error(res.msg)
           // })
           this.$Message.success('成功!')
         } else {
           this.$Message.error('表单验证失败!')
         }
       })
     },
     //关闭标签页
     ...mapMutations([
       'closeTag'
     ]),
     close () {
       this.closeTag({
         name: 'statement-edit',
         // params: {
         //   row: this.$route.params.row
         // }
       })
     },
     // 返回按钮
     btnClick1 () {
       this.close()
     }
   }
 };
 </script>
 <style lang="less">
 </style>
